package 蓝桥第二期2024;

import java.util.ArrayList;

public class 倍数 {
    public static void main(String[] args) {
        /*
        * 计算number数组中存在24的倍数
        * */
        int n = 24;
        int max = 0;
        ArrayList<String> n_list = new ArrayList<>();
        ArrayList<String> he_list = new ArrayList<>();
        for (int i = 1; i < 100; i++) {
            String sum = 24 * i + "";
            n_list.add(sum);
        }
        int[] number = {534, 386, 319, 692, 169, 338, 521, 713, 640, 692, 969, 362, 311, 349, 308, 357, 515, 140, 591, 216,
                57, 252, 575, 630, 95, 274, 328, 614, 18, 605, 17, 980, 166, 112, 997, 37, 584, 64, 442, 495,
                821, 459, 453, 597, 187, 734, 827, 950, 679, 78, 769, 661, 452, 983, 356, 217, 394, 342, 697, 878,
                475, 250, 468, 33, 966, 742, 436, 343, 255, 944, 588, 734, 540, 508, 779, 881, 153, 928, 764, 703,
                459, 840, 949, 500, 648, 163, 547, 780, 749, 132, 546, 199, 701, 448, 265, 263, 87, 45, 828, 634
        };
        for (int i = 0; i < number.length - 1; i++) {
            for (int j = i + 1; j < number.length - 1; j++) {
                String count = number[i] + number[j] + "";
                he_list.add(count);
            }
        }
        v:
        for (int i = 0; i < he_list.size(); i++) {
            for (int i1 = 0; i1 < n_list.size(); i1++) {
                boolean flag = he_list.get(i).equals(n_list.get(i1));
                if (flag) {

                    String str = he_list.get(i);
                    int num = Integer.parseInt(str);
                    System.out.print(num + ",");
                    if (num >= max) {
                        max = num;
                    }
                    continue v;
                }
            }
        }
        System.out.println();
        System.out.println(max);

    }
}
